
import { _decorator, Component, Node, sys} from 'cc';
const { ccclass, property } = _decorator;

const Debug = true;
const colorLog = (color:string) => (...params:any[]) =>{
    if (!Debug){
        return
    }
    if (sys.isNative){
        console.log(...params);
    }else{
        console.log('%c%s',`color:${color}`,...params);
    }
}

const infoLog = colorLog('#0000ff');
const warnLog = colorLog('#ff0000');

export class CLog{
    static info(message?: any, ...optionalParams: any[]){
        infoLog(...arguments);
    }
    static warn(message?: any, ...optionalParams: any[]){
        warnLog(...arguments);
    }
}
